package dome3;

public class TestDome3 {

    public static void run(IRunning iRunning){
        iRunning.run();
    }

    public static void swim(ISwimming iSwimming){
        iSwimming.swim();
    }

    public static void fly(IFlying iFlying){
        iFlying.fly();
    }

    public static void eating(Animal animal){
        animal.eat();
    }

    public static void main(String[] args) {
        run(new Dog("小小",3));
         run(new Duck("嘎嘎",2));
         eating(new Duck("嘎嘎",2));
         fly(new Duck("嘎嘎",2));
         swim(new Duck("嘎嘎",2));
         eating(new Frog("呱呱",1));
         run(new Frog("呱呱",1));
         swim(new Frog("呱呱",1));
    }
}
